package com.itheima.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.health.pojo.CheckItem;
import com.itheima.health.pojo.CheckgroupAndCheckitem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author kcs
 * @date 2021/11/23
 * @TIME:10:47
 */
@Mapper
public interface CheckItemMapper extends BaseMapper<CheckItem> {

    //判断关系表中是否存在该检查项
    @Select("select * from t_checkgroup_checkitem where checkitem_id = #{id}")
    CheckgroupAndCheckitem findById(Integer id);

    //在关系表中删除该检查项的所有数据
    @Delete("delete from t_checkgroup_checkitem where checkitem_id = #{id}")
    void delete(Integer id);
}
